﻿using Agile.Infra.Code;

namespace Microsoft.Extensions.DependencyInjection;

public static class ServiceCollectionExtension
{
    public static IServiceCollection AddORCode(this IServiceCollection services)
    {
        if (services.HasRegistered(nameof(AddORCode)))
            return services;

        QuestPDF.Settings.License = QuestPDF.Infrastructure.LicenseType.Community;
        QuestPDF.Settings.CheckIfAllTextGlyphsAreAvailable = false;

        services.AddSingleton<IORCodeService, ORCodeService>();
        return services;
    }

    //public static IServiceCollection AddBarCode(this IServiceCollection services)
    //{
    //    if (services.HasRegistered(nameof(AddBarCode)))
    //        return services;

    //    return services;
    //}
}